a = {
    'a':1,
    'b':2,
    'c':3,
}

b = {
    'b':4,
    'd':5,
}


updated = {**a, **b}

# 合并
print(updated)

a = {
    'a':1,
    'b':2,
}

b = {
    'a':2,
    'b':3,
}

# 合并
merge = {**a, **b}
print(merge)

# 合并并更新
updated = {**a, **b}
print("updated:",updated)
# 更新指定的鍵值
updated.update({'c':4})

print("update:",updated)

obj = {
    "a":1,
    "b":2,
    "c":3,
}

# 剔除某个键值
obj.pop('a')
print("剔除a键值后的obj:",obj)


obj2 = {
    "a":1,
    "b":2,
    "c":3,
}

print("before clear:",obj2)

obj2.clear()

print("after clear:",obj2)


